<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Familiar Kinds</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
MathJax = {
	tex: {
		inlineMath: '$', '$'], ['\\(', '\\)'
	},
	svg: {
		fontCache: 'global'
	}
};
</script>
<script type="text/javascript" id="MathJax-script" async
	src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js">
</script>

<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Familiar Kinds' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../services.html">Services</a></li><li><a href="index.html">kinds</a></li><li><a href="index.html#2">Chapter 2: Kinds</a></li><li><b>Familiar Kinds</b></li></ul></div>
<p class="purpose">To recognise certain kind names as familiar built-in ones.</p>

<ul class="toc"><li><a href="2-fk.html#SP11">&#167;11. Kind names in Inter code</a></li><li><a href="2-fk.html#SP12">&#167;12. Kind names in source text</a></li></ul><hr class="tocbar">

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b>In the Inform source code, we're clearly going to need to refer to some
kinds explicitly, and we need a way to do that. We adopt two naming conventions:
</p>

<ul class="items"><li>(i) Kinds are written as <span class="extract"><span class="extract-syntax">K_source_text_name</span></span>, that is, <span class="extract"><span class="extract-syntax">K_</span></span> followed by
the name of the kind in I7 source text, with spaces made into underscores.
For instance, <span class="extract"><span class="extract-syntax">K_number</span></span>. These are all <span class="extract"><span class="extract-syntax">kind *</span></span> global variables
which are initially <span class="extract"><span class="extract-syntax">NULL</span></span>, but which, once set, are never changed.
</li><li>(ii) Constructors are likewise written as <span class="extract"><span class="extract-syntax">CON_source_text_name</span></span> if they can
be created in source text; or by <span class="extract"><span class="extract-syntax">CON_TEMPLATE_NAME</span></span>, that is, <span class="extract"><span class="extract-syntax">CON_</span></span>
followed by the constructor's identifier as given in the command
which created it (but with the <span class="extract"><span class="extract-syntax">_TY</span></span> suffix removed) if not. These are all
<span class="extract"><span class="extract-syntax">kind_constructor *</span></span> global variables which are initially <span class="extract"><span class="extract-syntax">NULL</span></span>, but which,
once set, are never changed.
</li></ul>
<p class="commentary">We will now define all of the <span class="extract"><span class="extract-syntax">K_...</span></span> and <span class="extract"><span class="extract-syntax">CON_...</span></span> used by the core of
Inform. The <a href="index.html" class="internal">kinds</a> module does not need all of these to be created: for
example, in a Basic Inform compilation, <span class="extract"><span class="extract-syntax">stored action</span></span> never will be.
The variable <span class="extract"><span class="extract-syntax">K_stored_action</span></span> will then remain <span class="extract"><span class="extract-syntax">NULL</span></span>, but will also never
be used for anything, so no harm is done.
</p>

<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b>We begin with the protocol-like "kinds of kinds", the superheroes of the
kinds world:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_value</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_stored_value</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_pointer_value</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_sayable_value</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_understandable_value</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_arithmetic_value</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_real_arithmetic_value</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_enumerated_value</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b>Next, some awkward punctuation-like special base kinds needed in order
to construct things. These are used in combination to make tuples, that is,
collections \((K_1, K_2, ..., K_n)\) of kinds of value.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CON_TUPLE_ENTRY</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_void</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CON_VOID</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. </b>Thus we store \(()\) (the empty tuple) as <span class="extract"><span class="extract-syntax">CON_VOID</span></span>, we store \((A)\) as:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">CON_TUPLE_ENTRY</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">A</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">CON_VOID</span>
</pre>
<p class="commentary">so that \(A\) and \((A)\) are distinguishable, and continue. For example, \((A, B, C)\) is:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">CON_TUPLE_ENTRY</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">A</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">CON_TUPLE_ENTRY</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">B</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">CON_TUPLE_ENTRY</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">C</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">CON_VOID</span>
</pre>
<p class="commentary">This traditional LISP-like device enables us to store tuples of arbitrary
size without need for any constructor of arity greater than 2.
</p>

<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. </b><span class="extract"><span class="extract-syntax">K_unknown</span></span> plays no role in the type system &mdash; as noted in <a href="P-wtmd.html" class="internal">What This Module Does</a>,
the way to express "unknown kind" is to use the value <span class="extract"><span class="extract-syntax">NULL</span></span>. The purpose of
<span class="extract"><span class="extract-syntax">K_unknown</span></span> is purely so that run-time code generated by Inform has a way
to mark out empty lists as having entries of no known kind.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_nil</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CON_NIL</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_unknown</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CON_UNKNOWN</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. </b><span class="extract"><span class="extract-syntax">CON_INTERMEDIATE</span></span> is used to represent kinds which are brought into being
through uncompleted arithmetic operations: see <a href="3-dmn.html" class="internal">Dimensions</a> for a full
discussion.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CON_INTERMEDIATE</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. </b><span class="extract"><span class="extract-syntax">CON_KIND_VARIABLE</span></span> is used to formally represent kind variables, such as
the letter <span class="extract"><span class="extract-syntax">K</span></span>:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CON_KIND_VARIABLE</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>&#167;8. </b>So much for the exotica: back onto familiar ground for anyone who uses
Inform. Some standard kinds follow. Some belong only to features; if the
feature in question is inactive, they will remain <span class="extract"><span class="extract-syntax">NULL</span></span> and do nothing.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_equation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_grammatical_gender</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_natural_language</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_number</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_object</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_real_number</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_response</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_snippet</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_table</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_text</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_truth_state</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_unicode_character</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_use_option</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_verb</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_version_number</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary firstcommentary"><a id="SP9" class="paragraph-anchor"></a><b>&#167;9. </b>And here are two more standard kinds, but which most Inform users don't
realise are there, because they are omitted from the Kinds index:
</p>

<ul class="items"><li>(a) <span class="extract"><span class="extract-syntax">K_rulebook_outcome</span></span>. Rulebooks end in success, failure, no outcome, or
possibly one of a range of named alternative outcomes. These all share a
single namespace, and the names in question share a single kind of value.
It's not a very elegant system, and we really don't want people storing
these in variables; we want them to be used only as part of the process of
receiving the outcome back. So although there's no technical reason why this
kind shouldn't be used for storage, it's hidden from the user.
</li><li>(b) <span class="extract"><span class="extract-syntax">K_understanding</span></span> is used to hold the result of a grammar token. An actual
constant value specification of this kind stores a <span class="extract"><span class="extract-syntax">command_grammar *</span></span> pointer.
</li></ul>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_rulebook_outcome</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K_understanding</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary firstcommentary"><a id="SP10" class="paragraph-anchor"></a><b>&#167;10. </b>Finally, the standard set of constructors:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CON_list_of</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CON_description</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CON_relation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CON_rule</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CON_rulebook</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CON_activity</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CON_phrase</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CON_property</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CON_table_column</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CON_combination</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CON_variable</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary firstcommentary"><a id="SP11" class="paragraph-anchor"></a><b>&#167;11. Kind names in Inter code.</b>We defined some "constant" kinds and constructors above, to provide values
like <span class="extract"><span class="extract-syntax">K_number</span></span> for use in this C source code. We will also want to refer to
these kinds in the Inter code generated by Inform, where they will have
identifiers such as <span class="extract"><span class="extract-syntax">NUMBER_TY</span></span>.
</p>

<p class="commentary">So we need a way of pairing up names in these two source codes, and here
it is. There is no need for speed here.
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="identifier-syntax">text_of_I6_name</span><span class="plain-syntax">, </span><span class="identifier-syntax">what_have_you</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">sn</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Str::eq_narrow_string</span><span class="plain-syntax">(</span><span class="identifier-syntax">sn</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_of_I6_name</span><span class="plain-syntax">))) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">what_have_you</span><span class="plain-syntax">;</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">kind_constructor</span><span class="plain-syntax"> **</span><span class="function-syntax">FamiliarKinds::known_con</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">FamiliarKinds::known_con</span></span>:<br/>Kind Constructors - <a href="4-kc2.html#SP11">&#167;11</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sn</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"ACTIVITY_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">CON_activity</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"COMBINATION_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">CON_combination</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"DESCRIPTION_OF_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">CON_description</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"INTERMEDIATE_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">CON_INTERMEDIATE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"KIND_VARIABLE_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">CON_KIND_VARIABLE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"LIST_OF_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">CON_list_of</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"PHRASE_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">CON_phrase</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"NIL_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">CON_NIL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"VOID_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">CON_VOID</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"PROPERTY_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">CON_property</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"RELATION_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">CON_relation</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"RULE_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">CON_rule</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"RULEBOOK_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">CON_rulebook</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"TABLE_COLUMN_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">CON_table_column</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"TUPLE_ENTRY_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">CON_TUPLE_ENTRY</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"UNKNOWN_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">CON_UNKNOWN</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"VARIABLE_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">CON_variable</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">kind</span><span class="plain-syntax"> **</span><span class="function-syntax">FamiliarKinds::known_kind</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">FamiliarKinds::known_kind</span></span>:<br/>Kind Constructors - <a href="4-kc2.html#SP11">&#167;11</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sn</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"ARITHMETIC_VALUE_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_arithmetic_value</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"ENUMERATED_VALUE_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_enumerated_value</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"EQUATION_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_equation</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"TEXT_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_text</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"NUMBER_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_number</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"OBJECT_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_object</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"POINTER_VALUE_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_pointer_value</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"STORED_VALUE_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_stored_value</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"REAL_ARITHMETIC_VALUE_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_real_arithmetic_value</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"REAL_NUMBER_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_real_number</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"RESPONSE_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_response</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"RULEBOOK_OUTCOME_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_rulebook_outcome</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"SAYABLE_VALUE_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_sayable_value</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"UNDERSTANDABLE_VALUE_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_understandable_value</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"SNIPPET_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_snippet</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"TABLE_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_table</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"TRUTH_STATE_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_truth_state</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"UNDERSTANDING_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_understanding</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"UNKNOWN_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_unknown</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"UNICODE_CHARACTER_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_unicode_character</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"USE_OPTION_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_use_option</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"VALUE_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"VERB_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_verb</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"VERSION_NUMBER_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_version_number</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"NIL_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_nil</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IDENTIFIERS_CORRESPOND</span><span class="plain-syntax">(</span><span class="string-syntax">"VOID_TY"</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K_void</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">FamiliarKinds::is_known</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">FamiliarKinds::is_known</span></span>:<br/>Neptune Syntax - <a href="4-ns.html#SP5_2">&#167;5.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sn</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-fk.html#SP11" class="function-link"><span class="function-syntax">FamiliarKinds::known_con</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">sn</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-fk.html#SP11" class="function-link"><span class="function-syntax">FamiliarKinds::known_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">sn</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP12" class="paragraph-anchor"></a><b>&#167;12. Kind names in source text.</b>Inform creates the "natural language" kind in source text, not by loading it
from a file, but we still need to refer to it in the compiler. Similarly for
"grammatical gender". The others here are not referred to in the compiler,
but are indexed together.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="function-syntax">&lt;notable-linguistic-kinds&gt;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">natural</span><span class="plain-syntax"> </span><span class="identifier-syntax">language</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">grammatical</span><span class="plain-syntax"> </span><span class="identifier-syntax">gender</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">grammatical</span><span class="plain-syntax"> </span><span class="identifier-syntax">tense</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">narrative</span><span class="plain-syntax"> </span><span class="identifier-syntax">viewpoint</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">grammatical</span><span class="plain-syntax"> </span><span class="reserved-syntax">case</span>
</pre>
<p class="commentary firstcommentary"><a id="SP13" class="paragraph-anchor"></a><b>&#167;13. </b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">FamiliarKinds::notice_new_kind</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">FamiliarKinds::notice_new_kind</span></span>:<br/>Kinds - <a href="2-knd.html#SP23">&#167;23</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax">, </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">W</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;notable-linguistic-kinds&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><a href="4-kc2.html#SP16" class="function-link"><span class="function-syntax">KindConstructors::mark_as_linguistic</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">construct</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;&lt;r&gt;&gt;</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span><span class="plain-syntax">: </span><span class="identifier-syntax">K_natural_language</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">NOTIFY_NATURAL_LANGUAGE_KINDS_CALLBACK</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">NOTIFY_NATURAL_LANGUAGE_KINDS_CALLBACK</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">1</span><span class="plain-syntax">: </span><span class="identifier-syntax">K_grammatical_gender</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="2-knd.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-km.html">1</a></li><li class="progresscurrentchapter">2</li><li class="progresssection"><a href="2-knd.html">knd</a></li><li class="progresscurrent">fk</li><li class="progresssection"><a href="2-tlok.html">tlok</a></li><li class="progresssection"><a href="2-dk.html">dk</a></li><li class="progresssection"><a href="2-uk.html">uk</a></li><li class="progresschapter"><a href="3-dmn.html">3</a></li><li class="progresschapter"><a href="4-abgtn.html">4</a></li><li class="progressnext"><a href="2-tlok.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

